<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateSettingRechargeTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('setting_recharge', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->tinyInteger('platform')->default(1)->comment('平台：1-苹果，2-安卓');
            $table->tinyInteger('type')->default(1)->comment('充值类型：1-普通，2-首充赠送，3-超值赠送');
            $table->double('rmb')->default(0.0)->comment('支付金额');
            $table->smallInteger('coin')->default(0)->comment('充值金币');
            $table->smallInteger('first_send_coin')->default(0)->comment('首充额外赠送金币');
            $table->smallInteger('send_coin')->default(0)->comment('每笔充值赠送金币');
            $table->tinyInteger('idx')->default(1)->comment('排序');
            $table->smallInteger('admin_id')->default(0)->comment('操作管理员ID');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('状态：0-无效，1-有效');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('setting_recharge');
    }
}
